Private Sub Menu_FileSelection_Click(Index As Integer)
' One of the 2 File menu items were selected, so determine which one
' and perform the corresponding task.
'
Select Case Index
Case MID_OPEN
Open_Selected_Icon
Case MID_EXIT
Unload Viewer
End Select
End Sub
Private Sub Menu_HelpSelection_Click(Index As Integer)
If Index < MID_ABOUT Then
'
' Determine what help topic to display. The *Index* and *Using Help*
' items are the same for both the Viewer and the Editor, but the
' items: Keyboard and Commands are different and have
' different Help topic ID's, so we add 3 to the Menu item which
' will then make the Index correspond to the correct Help topic.
'
If (Index >= MID_KEYBOARD) And (Index <= MID_COMMANDS) Then Index = Index + 3
Get_Help Index
Else
' Display the IconWorks About box
'
AboutBox.Show MODAL
End If
End Sub
Private Sub Menu_OptionsSelection_Click(Index As Integer)
' One of the 3 Options menu items were selected, so determine which one
' and perform the corresponding task.
'
Select Case Index
Case MID_EDITOR
' Invoke the Editor, but do not open the selected Icon
'
Editor.Show MODELESS
Case MID_SHOW_ALL_ICONS
' Check for too man Icons to display. maximum of 963.
'
If File_FileList.ListCount > 900 Then
MsgBox "Can display upto a maximum of 900 icons", 16, "Too many Icons"
Else
'
' Let the rest of the Viewer know that all the Icons are currently
' begin displayed.
'
Temp = ShowingAllIcons
ShowingAllIcons = True
' Before showing all the icons, the values for the scrollbar must
' be re-calculated based on the number of icons in the current
' directory. Since this is done when the form is resized, we can
' accomplish this by calling the Form_Resize event to do this for us.
'
If Not Temp Then Form_Resize
' We disable the Edit.Copy menu Item, since after all icons are
' displayed, no one icon will be selected yet.
'
Menu_EditCopy.Enabled = False
' Load all the icons and then display them
'
Load_All_Icons
Update_Displayed_Icons
End If
Case MID_SHOW_ON_DIR_CHANGE
'
' Toggle the Checked property of the *Show all icons* options.
'
Menu_OptionsSelection(MID_SHOW_ON_DIR_CHANGE).Checked = Not Menu_OptionsSelection(MID_SHOW_ON_DIR_CHANGE).Checked
If Menu_OptionsSelection(MID_SHOW_ON_DIR_CHANGE).Checked And Menu_OptionsSelection(MID_SHOW_ALL_ICONS).Enabled Then Menu_OptionsSelection_Click MID_SHOW_ALL_ICONS
End Select
End Sub
Private Sub Open_Selected_Icon()
Dim OldPattern As String
If VLastChanged = DIR_CHANGED Then
'
' The directory was the last control accessed, so we need only
' set its Path to is currently selected item, which will generate
' a Change event for the Directory control, which will take care